package com.bigdata.demo.service.impl;


import com.bigdata.demo.dao.UserDao;
import com.bigdata.demo.entity.User;
import com.bigdata.demo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {
     @Autowired //(required = false)
     UserDao userDao;
    @Override
    public List<User> getAllUser() {
        return userDao.getAllUser();
    }


    @Override
    public User getUserByName(String userName) {
        return userDao.getUserByName(userName);
      }
    @Override
    public User getUserById(Integer userId){
        return userDao.getUserById(userId);
    }

        @Override
        public int addUser(User User) {
            return userDao.addUser(User);
        }
}
